package cn.huoyingkeji.system.service.impl;

import cn.huoyingkeji.system.dto.ResourceDTO;
import cn.huoyingkeji.system.entity.SysResource;
import cn.huoyingkeji.system.mapper.SysResourceMapper;
import cn.huoyingkeji.system.service.ResourceService;
import cn.hutool.core.bean.BeanUtil;
import cn.huoyingkeji.mybitisplus.service.impl.MybatisplusServiceImpl;

import org.springframework.stereotype.Service;

@Service
public class SysResourceServiceServiceImpl extends MybatisplusServiceImpl<SysResourceMapper, SysResource, ResourceDTO> implements ResourceService{

    @Override
    public ResourceDTO toDTO(SysResource resource) {
        ResourceDTO resourceDTO = new ResourceDTO();
        BeanUtil.copyProperties(resource, resourceDTO, false);
        return resourceDTO;
    }

    @Override
    public SysResource toEntity(ResourceDTO dto) {
        SysResource sysResource = new SysResource();
        BeanUtil.copyProperties(dto, sysResource , false);
        return sysResource;
    }

    
}
